<template>
	<!-- 我的监理 -->
	<div class="my-supervision">
		<h1>我的监理</h1>
		<div class="explain">
			<div>
				<img class="avatar" :src="supervisionItem.userPicture" />
			</div>
			<div class="text">
				<span>监理师姓名：{{ supervisionItem.name }}</span>
				<br />
				<span>监理师号码：{{ supervisionItem.mobile }} </span>
			</div>
		</div>
		<br />
		<h3>监理师介绍</h3>
		<br />
		<textarea class="teacher-explain" v-model="supervisionItem.userIntroduce"></textarea>
	</div>
</template>

<script>
	import path from '@/api/path.js';
	import axios from '@/libs/api.request';
	let url = path.url;

	export default {
		data() {
			return {
				supervisionItem: {}
			}
		},
		methods: {
			// 获取监理师信息
			getmySuperviseInfo() {
				axios.request({
					url: `${url}user/getUserSupervision`,
					method: 'post',
					data: {
						id: this.id
					}
				}).then(res => {
					if (res.data.status == 1) {
						this.supervisionItem = res.data.content
					} else {
						throw '获取数据失败！'
					}
				})
			}
		},
		created() {
			// 获取监理信息
			this.getmySuperviseInfo();
		},
		props: ['id']
	}
</script>

<style scoped="scoped" lang="scss">
	.explain {
		display: flex;
		justify-content: flex-start;
		align-items: flex-end;

		.avatar {
			width: 150px;
			margin: 20px 20px 0 0;
		}

		.text {
			margin-top: 20px;
			display: flex;
			flex-direction: column;
		}
	}
	.teacher-explain{
		width: 80%;
		height: 150px;
		padding: 20px;
	}
</style>
